package cn.ondraw.ragflow.controller;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import cn.ondraw.common.core.domain.R;
import cn.ondraw.ragflow.service.LLMService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 知识块
 */
@RestController
@Slf4j
@RequiredArgsConstructor
@RequestMapping("/v1/llm")
public class LLMController {
    private final LLMService llmService;

    /**
     * 模型列表
     */
    @GetMapping("/list")
    public R<Object> llmList() {
        try {
            return R.ok(llmService.llmList());
        } catch (Exception e) {
            return R.fail(e.getMessage());
        }
    }
}
